class: center, middle, inverse, title-slide # Labelling {ggplot2} maps --- layout: true <div class="dk-footer"> <span> <a href="https://rfortherestofus.com/" target="_blank">R for the Rest of Us </a> </span> </div> --- class: center, middle, dk-section-title background-image:url("images/pexels-photo-1111313.jpeg") background-size: cover # Labelling {ggplot2} maps --- ## Labelling {ggplot2} with {ggrepel} .pull-left[ <center><img src='images/ggrepel-allison_horst.jpg'/></center> ] .pull-right[ The `{ggrepel}` package makes it easy to label almost all geoms in ggplot2 charts. ] --- ## Labelling {ggplot2} with {ggrepel} .pull-left[ <center><img src='images/ggrepel-allison_horst.jpg'/></center> ] .pull-right[ The `{ggrepel}` package makes it easy to label almost all geoms in ggplot2 charts. It doesn't (**yet**) work with {sf} objects without a bit of manual work. ] --- class: my-turn ## My Turn .pull-left[ This dataset was used previously to introduce geocoding with the {tidygeocoder} package. I'm going to use {ggrepel} to label the points. ] .pull-right[ <img src="data:image/png;base64,#02_03_labelling-ggplot2-maps_files/figure-html/unnamed-chunk-4-1.png" width="400px" /> ] --- class: inverse ## Your turn 1. Use the `your-turn.R` script to create a geoscatter plot of the 10 largest cities in Germany<sup>1</sup> 1. Use `geom_label_repel()` to label the cities .footnote[ [1] Feel free to swap to a different country! ]